home *** CD-ROM | disk | FTP | other *** search
- % $Header: c:/tads/doc/RCS/tadsdef.tex 1.2 92/11/13 16:45:15 mroberts Exp $
- % tadsdef.tex - General definitions for the TADS documentation.
- %
- % This file should be included in each TeX file making up the
- % TADS documentation. It defines macros, fonts, and more.
- %
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Some General Definitions %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- %
- % Fonts
- %
- \font\bigrm=cmr10 scaled\magstep5
- \font\bigss=cmss17 scaled\magstep0
- \font\bigssi=cmssi17 scaled\magstep0
- \font\twelverm=cmr12 scaled\magstep0
- \font\twelvebf=cmbx12 scaled\magstep0
- \font\tenbf=cmbx10
- \font\tenrm=cmr10
- \font\tenit=cmti10
- \font\seventeenrm=cmr17
- \font\chfont=cmr10 scaled 2000
- \font\smallcaps=cmr8
-
- % quotation fonts
- \font\eightss=cmssq8
- \font\eightssi=cmssqi8
- \font\ninett=cmtt9
-
-
- %
- % Pagesize: use about half an inch less than usual, to make the pages
- % a little less black and leave some room for binding. Leave the vertical
- % size of the page alone.
- %
- \advance\hsize by-0.5in
- \vsize=44pc
- \newdimen\pageheight \newdimen\pagewidth
- \pageheight=\vsize \pagewidth=\hsize
-
- %
- % Paragraph layout: use no indentation; leave some vertical blank space
- % between paragraphs intead.
- %
- \parindent=0pt
- \parskip=\medskipamount
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Here we define some macros useful for typesetting examples text. These %
- % examples will be shown in \tt mode, with appropriate indentation. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- %
- % \lb and \rb put up left and right braces (respectively); they also
- % indent another tab stop. These guys should be used in \tt mode for
- % example text only.
- %
- \def\lb{\char`\{\vskip0in\advance\leftskip1em\vskip0in}
- \def\rb{\vskip0in\advance\leftskip-1em\char`\}\vskip0in}
- \def\invislb{\vskip0in\advance\leftskip1em\vskip0in}
- \def\invisrb{\vskip0in\advance\leftskip-1em\vskip0in}
-
- %
- % \example enters \tt mode, and sets up other nice things for an example;
- % specifically, we do a \medskip and then indents subsequent text. This
- % macro also ensures that source line breaks will be obeyed.
- %
- \def\example{\tt\parskip=0pt\obeylines\medskip\advance\leftskip1em\vskip0in}
-
- %
- % \object# puts up "#: object" and indents subsequent lines.
- % Should only be used in \tt mode.
- %
- \def\object#1{#1\vskip0in\advance\leftskip1em\vskip0in}
-
- %
- % \endobj ends the object definition with an appropriately placed semicolon
- % and a \medskip. Use only in \tt mode.
- %
- \def\endobj{\vskip0in\advance\leftskip-1em ;\medskip}
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Page Layout Definitions %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- %
- % Page footer definitions. These are called when a chapter heading
- % is output to affect the pages that follow.
- %
- % The \rtitle macro is the title of the book; the \rhead is the running
- % chapter header. \rtitle should stay the same throughout the book,
- % whereas \rhead is changed automatically by the \chapterhead macro.
- %
- \newdimen\realhsize
- \newdimen\realvsize
- \realhsize=\hsize
- \realvsize=\vsize
- \newif\iftitle
- \newif\ifchapter
- \newif\ifthinrule
- \def\rfoot{\relax}
- \def\footline{%
- \ifodd\pageno\rightfootline \else\leftfootline\fi}
- \def\rightfootline{\hbox to\realhsize{%
- \vbox to 10pt{}{\tenrm\hfil\rfoot\hskip0.5in\folio}}}
- \def\leftfootline{\hbox to \realhsize{%
- \vbox to 10pt{}{\tenrm\folio\hskip0.5in\rtitle\hfil}}}
- \def\chfoot{%
- \ifodd\pageno\rightchfoot \else\leftchfoot\fi}
- \def\rightchfoot{\hbox to\realhsize{%
- \vbox to 10pt{}{\tenrm\hfil\folio}}}
- \def\leftchfoot{\hbox to \realhsize{%
- \vbox to 10pt{}{\tenrm\folio\hskip0.5in\rtitle\hfil}}}
-
- \def\rtitle{The TADS Author's Manual}
-
- \def\onepageout#1{\shipout\vbox{
- \offinterlineskip
- \vbox to\pageheight{#1}
- \vbox to 3pc{\vfill\iftitle\global\titlefalse\else%
- \ifchapter\chfoot\global\chapterfalse\else\footline\fi\fi%
- \boxmaxdepth=\maxdepth}}
- \advancepageno
- }
-
- \output{\onepageout{\unvbox255}}
-
-
- %
- % A Chapter definition displays a wizzy chapter header page, with the
- % indicated text, and adjusts the footer line to print the chapter name
- % and number along with the page number.
- %
- % At the end of the chapter preface page, put the \chapterbody macro to
- % go into regular chapter page mode. Note also that a square bullet, to
- % provide a sense of termination to the blurb, can be added with the
- % macro \bull.
- %
- % Chapters, therefore, are defined like this:
- %
- % \chapterheader{Chapter Two}{Commands}
- % <chapter preface blurb>\bull
- % \chapterbody
- % <chapter body text...>
- %
-
- \def\chapterheader#1#2#3{
- \message{#1 #2} % display a message
- \eject\null % start a new page
- \ifodd\pageno \else \vfill\eject\null \fi % yet another if it's now even
- \xdef\rfoot{{\tenit #1}\hskip0.25in{\tenbf #2}} % define new chapter footer
- \vskip 0.5in
- {\seventeenrm #1}
- \smallskip\hrule\smallskip
- {\chfont\hfill #2}
- \vskip 0.5in
- %\vbox{\hfill$\diamond$\hskip0.5in$\diamond$\hskip 0.5in$\diamond$\hfill\null}
- \vskip 0.5in
- \write\toc{\string\contitem{#3}{#2}{\number\pageno}}
- \thinruletrue
- } % end of macro \chapterheader
-
- % \def\bull{\vrule height .9ex width .8ex depth -.1ex} % square bullet
- \def\bull{\relax} % nuke the bullet; do nothing
-
- \def\chapterbody{
- } % end of macro \chapterbody
-
- \outer\def\endchapter{\ifodd\pageno \else\vfill\eject\null\fi
- \begingroup\bigskip\vfill % start the quotes
- \def\eject{\endgroup\eject} % end the quotes at the next \eject
- \def\par{\ifhmode\/\endgraf\fi}\obeylines
- % \eightpoint
- \let\tt=\ninett \baselineskip=10pt
- \interlinepenalty=10000
- \leftskip=0pt plus 40pc minus \parindent \parfillskip=0pt
- \parskip=0pt
- \let\rm=\eightss \let\sl=\eightssi \everypar{\sl}}
- \def\author#1(#2){\smallskip\noindent\rm--- #1\unskip\enspace(#2)}
-
-
- %
- % A major section puts up an hrule to introduce the section, and puts the
- % section header in 12-point boldface type. A minor section is the same,
- % but with a 10-point boldface section title, and a thinner line.
- %
- \def\majorsection#1\par{%
- %\filbreak
- \vskip0.5in\message{#1}
- \ifthinrule \thinrulefalse\hrule \else \hrule height2pt \fi%
- \nobreak\medskip\leftline{\twelvebf #1}\nobreak\bigskip\nobreak}
-
- \def\minorsection#1\par{%
- %\filbreak
- \vskip0.25in\message{#1}
- \hrule\nobreak\smallskip\leftline{\bf #1}\nobreak\bigskip\nobreak}
-
-
- %
- % Indexing macros. These macros allow us to derive an index file
- % for later typesetting automatically as the manual is typeset.
- %
- \newwrite\inx
- \immediate\openout\inx=tadsindx
- \newif\ifsilent
- \def\specialhat{\ifmmode\def\next{^}\else\let\next=\beginxref\fi\next}
- \def\beginxref{\futurelet\next\beginxrefswitch}
- \def\beginxrefswitch{\ifx\next\specialhat\let\next=\silentxref
- \else\silentfalse\let\next=\xref\fi \next}
- \catcode`\^=\active \let ^=\specialhat
- \def\silentxref^{\silenttrue\xref}
-
- \chardef\bslash=`\\
- \def\xref{\futurelet\next\xrefswitch}
- \def\xrefswitch{\begingroup\ifx\next|\aftergroup\vxref %
- \else\ifx\next\<\aftergroup\anglexref %
- \else\aftergroup\normalxref \fi\fi \endgroup}
- \def\vxref|{\catcode`\\=\active \futurelet\next\vxrefswitch}
- \def\vxrefswitch#1|{\catcode`\\=0 %
- \ifx\next\empty\def\xreftype{2}%
- \def\next{{\tt\bslash\text}}%
- \else\def\xreftype{1}\def\next{{\tt\text}}\fi %
- \edef\text{#1}\makexref}
- {\catcode`\|=0 \catcode`\\=\active |gdef\{}}
- \def\anglexref\<#1>{\def\xreftype{3}\def\text{#1}%
- \def\next{\<\text>}\makexref}
- \def\normalxref#1{\def\xreftype{0}\def\text{#1}\let\next=\text\makexref}
-
- \def\makexref{\xdef\writeit{\write\inx{\text\space!\xreftype\space
- \noexpand\number\pageno.}}\writeit
- \ifsilent\ignorespaces\else\next\fi}
-
-
-